package com.eastcom.bm.service.impl;

import java.util.List;

import org.apache.log4j.Logger;

import com.eastcom.bm.atom.Atom_CalendarItem;
import com.eastcom.bm.dao.DAOFactory;
import com.eastcom.bm.dao.ICalendarItemDao;
import com.eastcom.bm.service.ICalendarItemService;
import com.eastcom.common.db.JDBCTemplate;
import com.eastcom.providor.BMSetting;

public class CalendarItemService implements ICalendarItemService {
	
	private static Logger log = BMSetting.getBMlog();
	
	public List<Atom_CalendarItem> getAllCalendarItems() {
		try{
			ICalendarItemDao itemDao=DAOFactory.getInstance().getCalendarItemDao();
			return itemDao.getAllCalendarItems();
		}
		catch(Exception e){
			log.error("ICalendarItemService getAllCalendarItems error",e);
		}
		finally{
			JDBCTemplate.doSessionFinally();
		}
		
		return null;
	}

	public List<Atom_CalendarItem> selectCalendarItemByPolicyUUID(String policyUUID) {
		try{
			ICalendarItemDao itemDao=DAOFactory.getInstance().getCalendarItemDao();
			return itemDao.selectCalendarItemByPolicyUUID(policyUUID);
		}
		catch(Exception e){
			log.error("ICalendarItemService selectCalendarItemByPolicyUUID error",e);
		}
		finally{
			JDBCTemplate.doSessionFinally();
		}
		
		return null;
	}
    
}
